﻿using Furion;
using iemtm.WeChat.Core;
using iemtm.WeChat.Core.Managers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace iemtm.WeChat.Web.Core.MVC
{
    /// <summary>
    /// 控制器基类
    /// </summary>
    public abstract class BaseController : Microsoft.AspNetCore.Mvc.Controller
    {
        /// <summary>
        /// 用户仓储
        /// </summary>
        private readonly IWorkManager _workManager;
        /// <summary>
        /// 构造函数
        /// </summary>

        public BaseController()
        {
            
            _workManager = App.GetService<IWorkManager>();
        }

  


        /// <summary>
        /// 获取用户 Id
        /// </summary>
        public int UserId { get => _workManager.UserId; }

        /// <summary>
        /// 获取用户信息
        /// </summary>
        public UserAccount CurrentUser { get => _workManager.CurrentUser; }

    }
}
